#Cmake最低版本要求
cmake_minimum_required(VERSION 3.21)

#项目名称
project(cglog)

#Library version
set(VERSION "2.0.0")
set(SOVERSION ${VERSION})

#set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")

# Glob sources, headers, tests
file(GLOB_RECURSE cglog_SOURCES src/*.cpp)
file(GLOB_RECURSE cglog_HEADERS include/cglog.h)
link_directories(./lib)

# Define C flags and include directories
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

# Declare library target
add_library(${PROJECT_NAME} ${cglog_SOURCES})
set_target_properties(cglog PROPERTIES SOVERSION ${VERSION})
target_link_libraries(${PROJECT_NAME} glog)

# Declare install targets
install(TARGETS cglog DESTINATION lib)
install(FILES ${cglog_HEADERS} DESTINATION include/cglog)
